#!/bin/bash

docker stop jz_crm_nacos
docker rm jz_crm_nacos
docker run -idt \
        --name jz_crm_nacos \
        --network common-network \
        --restart=always \
        -e JVM_XMS=512m -e JVM_XMX=512m -e JVM_XMN=384m \
        -e PREFER_HOST_MODE=ip \
        -e MODE=standalone \
        -e SPRING_DATASOURCE_PLATFORM=mysql \
        -e MYSQL_DATABASE_NUM=1 \
        -e MYSQL_MASTER_SERVICE_HOST=172.17.0.2 \
        -e MYSQL_MASTER_SERVICE_DB_NAME=jz_nacos \
        -e MYSQL_MASTER_SERVICE_PORT=3306 \
        -e MYSQL_MASTER_SERVICE_USER=root \
        -e MYSQL_MASTER_SERVICE_PASSWORD="jz-crm-mysql" \
        -p 8848:8848 \
        -v `pwd`/logs/:/home/nacos/logs \
        -v `pwd`/init.d/custom.properties:/home/nacos/init.d/custom.properties \
        nacos/nacos-server:1.1.4
